const App = {
  mixins: [Query],//配置文件，路径/utils/mixins.js
  data() {
    return {
      photo,
      page: {
        value1: '',
        value2:'',
        PageNumber: 1, //页码
        RowAmount: 10,
        Condition: window.btoa(unescape(encodeURIComponent("%%,%%,%%"))),
        ExtensionCondition: window.btoa(unescape(encodeURIComponent(" AND party_fees.Party_Organization_SerialNumber IN (" + getCookie('party') + ")"))),
      },
    }
  },
  mounted() {
    this.Treedata();
  },
  methods: {
    changeMonth(e) {
      if (e == null) {
        this.page.value2 = '';
      }
      console.log(e);
    },

    Treedata() {
      $.ajax({
        headers: requestHeaders(),
        url: `${mh}/permissionsTree/getPartyOrganizationsTreeByPermissions`,
        type: "GET",
        data: {
          PartyOrganizationsCode: getCookie('party'), //请求参数
        },
        success: (data) => {
          this.treeData = data;
        },
        complete: (XMLHttpRequest) => {
          requestPretreatment(XMLHttpRequest);
        },
        dataType: "json",
      });
    },
    handleAdd(row) {
      // window.location.href = "./add.html?action=Add";
      window.location.href = "./addBatch.html?action=Add";
    },
    check() {
      this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,%%," + this.page.value2 +"%")));
      this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent(" AND party_fees.Party_Organization_SerialNumber IN (" + getCookie('party') + ")")));
      this.postgetList(this.page);
    },
    //树的点击筛选事件
    handleNodeClick(data, node) {

      let str = "and party_fees.Party_Organization_SerialNumber='" + data.Party_Organization_SerialNumber + "'";

      this.page.ExtensionCondition = window.btoa(unescape(encodeURIComponent(" AND party_fees.Party_Organization_SerialNumber IN (" + getCookie('party') + ")" + str)));
      this.postgetList(this.page);
    },

  },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus, { locale: zhCn });
app.mount("#app");
